package com.ssss.template.exec;

public class HummerH2 extends HummerModel{

    private boolean alarmFlag = false;

    @Override
    protected void start() {
        System.out.println("H2发动");
    }

    @Override
    protected void engineBoom() {
        System.out.println("H2轰鸣");
    }

    @Override
    protected void alarm() {
        System.out.println("H2鸣笛");
    }

    @Override
    protected void stop() {
        System.out.println("H2停止");
    }

    /**
     * 钩子方法
     * @return
     */
    protected boolean isAlarm(){
        return this.alarmFlag;
    }

    public void setAlarmFlag(boolean alarmFlag) {
        this.alarmFlag = alarmFlag;
    }
}
